#!/usr/bin/python

def time_to_aperture(a, b):
	"""converts exposure time difference to aperture difference"""
	def ld(l):
		"logarithm to base 2"
		import math
		return math.log(l)/math.log(2)
	a, b = float(a), float(b)
	return ld( max(a,b) / min(a,b) )

def possible_dimensions(x, y, resolution=400):
	"""converts x,y image size in pixles into a paper print image size in mm"""
	mm_per_inch = 24.5
	return (float(x)/resolution*mm_per_inch, float(y)/resolution*mm_per_inch)

